<template>
  <div class="treeNoSearch">
    <!-- :default-expanded-keys="defaultexpandedKey" -->
    <!-- :default-selected-keys="defaultSelectedKey" -->
    <a-directory-tree
      :tree-data="treeData"
      @select="onSelect"
      :default-expand-all="expandFlag"
      :default-selected-keys="defaultSelectKeys"
      v-if="treeData.length>0"
      @expand="onExpand"
      :show-icon="true"
    ></a-directory-tree>
  </div>
</template>

<script>
export default {
  name: 'treeNoSearch',
  props: ['treeData', 'defaultSelectKeys', 'expandFlag'],
  data() {
    return {
      expandedKeys: [],
      autoExpandParent: true
    }
  },
  mounted() {
    // console.log(dataList);
  },
  methods: {
    onExpand(expandedKeys) {
      this.expandedKeys = expandedKeys
      this.autoExpandParent = false
    },
    onSelect(selectedKeys, info) {
      //   console.log(selectedKeys, info)

      this.$emit('treeKey', selectedKeys[0])
    },
    onCheck(checkedKeys, info) {
      console.log('onCheck', checkedKeys, info)
    }
  }
}
</script>

<style lang="less" scoped>
</style>
